<link href="/stylesheets/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<!--搜索框-->
<script src="/javascripts/bootstrap-datetimepicker.js"></script>
<script src="/javascripts/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<style type="text/css">
    .ingredientSel{
        width: 100%;
        list-style:none;
        overflow: hidden;
        white-space: nowrap;
        padding-left: 0px;
        padding-right: 0px;
    }
    .ingredientSel li{
        font-size: 14px;
        font-weight: bold;
        background: none;
        padding: 30px;
        background:ghostwhite;
        position: relative;
        border: none;
        margin-left:2px;
        display: inline;
    }
    .tRed{
        color: red;
    }
    .tGreen{
        color: green;
    }

    .dateStr{
        font-weight: bold;
        font-size: 14px;
        text-underline: none;
        padding-right: 5px;
        padding-left: 5px;
        line-height: 28px;
    }
    .datashow{
        display: none;
    }
</style>

<div class="container-fluid" ng-controller="cashFlowList" style="position:relative">
    <% include public/modal %>
    <!-- Page Heading -->
    <div class="row">
        <div class="col-lg-12">
            <ol class="breadcrumb" style="position:relative;margin-top:5px;margin-bottom:20px;">
                <li>
                    <i class="fa fa-cube"></i> 资金流动
                </li>
                <li class="active">资金流动
                </li>


                <div style="position:absolute;right:2%;top:23%;cursor:pointer;">
                    <i class="fa fa-plus-circle fa-lg" ng-click="mdfFun()"></i>
                </div>

            </ol>
            <% include public/tableTool %>

            <div class="pull-right">

                <form action="<%=currentLink%>" name="searchForm" id="searchForm" >
                    <div clas="input-group">
                        <a class="form_date dateStr" href="javascript:;" data-date-format="yyyy-mm-dd"> <input name="startDate" class="dateVal" id="startDate" type="hidden" value="<%=startDate %>"  ng-model="startDate"/><span><%=startDate %></span></a>
                        到
                        <a class="form_date dateStr" href="javascript:;" data-date-format="yyyy-mm-dd"><input name="endDate" class="dateVal"  id="endDate" type="hidden" value="<%=endDate %>" ng-model="endDate"/><span><%=endDate %></span></a>
                    </div>
                    <div class="input-group" >


                        <input type="text" name="searchKey" id="searchInput" class="form-control input-sm pull-right" style="width: 200px;" placeholder="请输入需要查询的关键字" value="<%= searchKey%>" ng-model="keywords"/>
                        <div class="input-group-btn" style="width: auto;">
                            <button class="btn btn-sm btn-default" type="button" id="serchBtn"><i class="fa fa-search"></i></button>
                        </div>
                    </div>
                </form>

            </div>


        </div>
    </div>
    <div  class="row" style="margin-top:10px;min-height:50px;">
        <div class="col-lg-12">
            <div class="table-responsive datashow" style="font-weight:bold;" >总收入:<span style="color: green">￥{{totalPrice.toFixed(0)}}</span>&nbsp;总支出:<span style="color: red">￥{{pay.toFixed(0)}}</span>&nbsp;利润:<span ng-class="{true: 'tGreen', false: 'tRed'}[(totalPrice-pay>0)]">￥{{(totalPrice-pay).toFixed(0)}}</span></div>
            <div class="table-responsive datashow">
                <table class="table table-hover table-striped">
                    <thead>
                    <tr>
                        <th style="width:10%"><input type="checkbox" class="mini" id="selectAll"/></th>
                        <th >类型</th>
                        <th >时间</th>
                        <th>金额</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="content in data" class="datalist"  style="cursor: pointer;">
                        <td><input type="checkbox" name="listItem" class="mini" value="{{content._id}}" ng-click="getNewIds($event)"/></td>
                        <td style="font-weight:bold;" ng-class="{true: 'tGreen', false: 'tRed'}[(content.type==0)]"> {{cashFlowTypes[content.type]}}</td>
                        <td>{{content.time|date:'yyyy-MM-dd hh:mm:ss' }}<br/><span style="font-weight: bold;color: #003399;">{{content.name}}</span>
                        </td>
                        <td style="font-weight:bold;" ng-class="{true: 'tGreen', false: 'tRed'}[(content.type==0)]"> ￥{{content.price.toFixed(2)}}</td>
                        <td>
                            <i class="fa fa-edit fa-lg"
                               ng-click="mdfFun(content._id)"
                               style="cursor:pointer;"></i>&nbsp;
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <% include public/tableFooter %>
        </div>
    </div>

    <!--提示确认模态窗口-->
    <div class="modal bs-example-modal-sm" id="mdfDiv" style="background-color: #ebebeb" data-backdrop="static">
        <div class="modal-dialog modal-sm" style="width:100%">
            <form method="post" ng-submit="processForm(myForm.$valid)" name="myForm">
                <div align="right" style="position: absolute;z-index: 99999999999;right:15px;">
                    <button type="submit" class="btn btn-default viewSty" ng-disabled="myForm.$invalid">保存</button>&nbsp;&nbsp;
                    <button type="button" class="btn btn-default"  data-dismiss="modal">返回</button>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-12">
                            <label>资金流动类型</label>
                            <div class="form-group input-group" style="width: 100%;">
                                <select class="form-control" name="cashFlowType" id="cashFlowType" ng-change="switchCashType()" ng-model="formData.cashFlowType">
                                    <% cashFlowTypes.forEach(function(cashFlowType, index) { %>
                                    <option value="<%= index %>" ><%=cashFlowType %></option>
                                    <% })%>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>备注</label>
                                <input class="form-control banSty" name="itemName" id="itemName"  ng-model="formData.name"  autocomplete="off"  ng-maxlength="10" required >
                                <label for="inputError" class="control-label text-danger" ng-show="myForm.itemName.$invalid"><i class="fa fa-times-circle-o"></i> 最多10个非特殊字符且不能为空</label>                                </div>
                            <div class="form-group">
                                <label>时间</label>
                                <div class="input-group date form_date_ex" data-date="" >
                                    <input class="form-control" size="16" type="text"  readonly id="purchaseDate" ng-model="formData.time" >
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="viewSty">明细列表</label>
                                <div class="field input-group" class="viewSty">
                                    <input type="text" class="form-control viewSty" name="nope" id="nope" placeholder="输入拼音缩写选择材料进行添加" />
                                    <span class="input-group-addon" ng-click="changeMode()"><span class="fa fa-file-text-o fa-lg"  style="cursor: pointer" id="cmode"></span></span>
                                    <span class="input-group-addon"><span class="fa fa-plus fa-lg" ng-click="addOther()" style="cursor: pointer"></span></span>
                                </div>
                                <script src="/javascripts/jquery.autocompleter.js"></script>
                                <div>
                                    <table class="table table-hover" id="cart" >
                                        <thead>
                                        <tr id="columnTr">
                                            <th width="25%">名称</th>
                                            <th width="20%">数量(斤)</th>
                                            <th width="20%">单价</th>
                                            <th width="20%">总价</th>
                                            <th width="10%"> </th>
                                        </tr>

                                        <tr class="counttr">
                                            <td style="font-weight:bold;">总计：</td><td colspan="2" ></td>
                                            <td style='color: red;font-weight: bold;'>￥<span id="totalcount">0</span></td><td></td>

                                        </tr>
                                        </thead>
                                    </table>
                                </div>

                            </div>


                        </div>

                    </div>
                    <!-- /.row (nested) -->
                </div>
            </form>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->


</div>
<script>
    $('.form_date_ex').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0
    });



</script>



